package cn.iocoder.yudao.module.system.dal.mysql.tenant;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.complaint.TenantComplaintPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantComplaintDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 租户投诉 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface TenantComplaintMapper extends BaseMapperX<TenantComplaintDO> {

    default PageResult<TenantComplaintDO> selectPage(TenantComplaintPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TenantComplaintDO>()
                .eqIfPresent(TenantComplaintDO::getTenantId, reqVO.getTenantId())
                .likeIfPresent(TenantComplaintDO::getTenantName, reqVO.getTenantName())
                .eqIfPresent(TenantComplaintDO::getComplaintReason, reqVO.getComplaintReason())
                .eqIfPresent(TenantComplaintDO::getEvidenceImages, reqVO.getEvidenceImages())
                .eqIfPresent(TenantComplaintDO::getUserId, reqVO.getUserId())
                .likeIfPresent(TenantComplaintDO::getUserName, reqVO.getUserName())
                .eqIfPresent(TenantComplaintDO::getStatus, reqVO.getStatus())
                .eqIfPresent(TenantComplaintDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(TenantComplaintDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(TenantComplaintDO::getUpdater, reqVO.getUpdater())
                .eqIfPresent(TenantComplaintDO::getRemark, reqVO.getRemark())
                .orderByDesc(TenantComplaintDO::getId));
    }

}